proc usermod {nick handle chan otbn1 otbn tcl host} {
global botnick home bcast
if {![matchattr $handle o|m $chan]} {
  putquick "NOTICE $nick :Unable To Execute Command - Permission Denied."
  return 0
  }
if {$otbn1 == ""} {
  putquick "NOTICE $nick :\0034ERROR - Invalid Syntax - Should Be - (/msg) $botnick usermod <#channel> <nick> <level>"
  return 0
  }
if {$otbn == ""} {
  putquick "NOTICE $nick :\0034ERROR - Unspecified Level - You need to specify '1' of these levels: avoice,aop,op,ccadmin,cadmin,bop,bcadmin,root"
  return 0
  }
if {[validuser $otbn1]} {
  set hand2 $otbn1
  } elseif {[onchan $otbn1 $chan]} {
  set hand2 [nick2hand $otbn1 $chan]
  } else {
  putquick "NOTICE $nick :\0034ERROR - Unknown User - User not found in user/root partition."
  return 0
  }
if {[matchattr $hand2 D]} { 
  putquick "NOTICE $nick :Unable To Execute Command - $hand2's user account is disabled - Enable $hand2's user account first - Permission Denied."
if {$bcast == "1"} {
  putquick "PRIVMSG $home :\002$nick\002 ($host) tried to usermod \002$hand2\002 in $chan - a disabled user account."
  }
  return 0
  }
if {[string match {avoice} $otbn] == 1} {
  putlog "!$nick ($host)! usermod $chan $hand2 avoice"
  putquick "NOTICE $nick :Sucessfully modified permissions for $otbn1 to 'avoice' on $chan"	  
if {$bcast == "1"} {
  putquick "PRIVMSG $home :\002$nick\002 ($host) requested me to usermod \002$hand2\002 to 'AutoVoice' on $chan" 
  }
  chattr $hand2 |+vf-aodknm $chan 
  save
  return 0
  }
if {[string match {op} $otbn] == 1} {
  putlog "!$nick ($host)! usermod $chan $hand2 op"	 
  putquick "NOTICE $nick :Sucessfully modified permissions for $otbn1 to 'op' on $chan"
if {$bcast == "1"} {
  putquick "PRIVMSG $home :\002$nick\002 ($host) requested me to usermod \002$hand2\002 to a 'Channel Operator' on $chan" 
  }
  chattr $hand2 |+of-vadknm $chan
  save
  return 0
  }
if {[string match {ccadmin} $otbn] == 1} {
if {![matchattr $handle o|n $chan]} {
  putquick "NOTICE $nick :Unable To Execute Command - Not Enough Permissions - Permission Denied."
  return 0
  }
  putlog "!$nick ($host)! usermod $chan $hand2 ccadmin"
  putquick "NOTICE $nick :Sucessfully modified permissions for $otbn1 to 'Channel Co-Administrator' on $chan"
if {$bcast == "1"} {
  putquick "PRIVMSG $home :\002$nick\002 ($host) requested me to usermod \002$hand2\002 to a 'Channel Co-Administrator' on $chan" 
  }
  chattr $hand2 |+mof-vadkn $chan
  save
  return 0
  }
if {[string match {cadmin} $otbn] == 1} {
if {![matchattr $handle o]} {
  putquick "NOTICE $nick :Unable To Execute Command - Not Enough Permissions - Permission Denied."
  return 0
  }
  putlog "!$nick ($host)! usermod $chan $hand2 cadmin" 
  putquick "NOTICE $nick :Sucessfully modified permissions for $otbn1 To 'Channel Administrator' on $chan"
if {$bcast == "1"} {
  putquick "PRIVMSG $home :\002$nick\002 ($host) requested me to usermod \002$hand2\002 to a 'Channel Administrator' on $chan" 
  }
  chattr $hand2 |+fmno-vadk $chan
  save
  return 0
  }
if {[string match {bop} $otbn] == 1} {
if {![matchattr $handle m]} {
  putquick "NOTICE $nick :Unable To Execute Command - Not Enough Permissions - Permission Denied."
  return 0
  }
  putlog "!$nick ($host)! usermod $hand2 bop"
  putquick "NOTICE $nick :Sucessfully modified permissions for $otbn1 to 'BotNet Operator'"
if {$bcast == "1"} {
  putquick "PRIVMSG $home :\002$nick\002 ($host) requested me to usermod \002$hand2\002 to a 'BotNet Operator'" 
  }
  chattr $hand2 +foxp-vtjdknm
  save
  return 0
  }
if {[string match {bcadmin} $otbn] == 1 } { 
if {![matchattr $handle n]} {
  putquick "NOTICE $nick :Unable To Execute Command - Not Enough Permissions - Permission Denied."
  return 0
  }
  putlog "!$nick ($host)! usermod $hand2 bcadmin"  
  putquick "NOTICE $nick :Sucessfully modified permissions for $otbn1 to 'BotNet Co-Administrator'"
if {$bcast == "1"} {
  putquick "PRIVMSG $home :\002$nick\002 ($host) requested me to usermod \002$hand2\002 to a 'BotNet Co-Administrator'" 
  }
  chattr $hand2 +fmoxtp-vjdkn
  save
  return 0
  }
if {[string match {root} $otbn] == 1} {
if {![matchattr $handle n]} {
  putquick "NOTICE $nick :Unable To Execute Command - Not Enough Permissions - Permission Denied."  
  return 0
  }
  putlog "!$nick ($host)! usermod $hand2 root" 
  putquick "NOTICE $nick :Sucessfully modified permissions for $otbn1 to 'root'"
if {$bcast == "1"} {
  putquick "PRIVMSG $home :\002$nick\002 ($host) requested me to usermod \002$hand2\002 to a 'BotNet Administrator (root)'" 
  }
  chattr $hand2 +fnmtoxjp-vdk
  save
  return 0
  }
if {[string match {aop} $otbn] == 1} {
if {![matchattr $handle o|m $chan]} {
  putquick "NOTICE $nick :Unable To Execute Command - Not Enough Permissions - Permission Denied."
  return 0
  }
  putlog "!$nick ($host)! usermod $chan $hand2 aop"
  putquick "NOTICE $nick :Sucessfully modified permissions for $otbn1 to 'AutoOp' on $chan"
if {$bcast == "1"} {
  putquick "PRIVMSG $home :\002$nick\002 ($host) requested me to usermod \002$hand2\002 to a 'AutoOp' on $chan" 
  }
  chattr $hand2 |+fa-nmdkvo $chan 
  save
  return 0
  }
  }









